How to calculate income